//
//  YJMenuCell.m
//  健康饮食
//
//  Created by qianfeng01 on 15/7/4.
//  Copyright (c) 2015年 qianfeng01. All rights reserved.
//

#import "YJMenuCell.h"
#import "UIImageView+WebCache.h"

@implementation YJMenuCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)showDataWithModel:(YJMenuModel *)model{
    self.nameLabel.text =model.name;
    self.dishesLabel.text =[NSString stringWithFormat:@"%ld道菜",(long)model.dishNum];
    self.browseLabel.text =[NSString stringWithFormat:@"浏览%ld",(long)model.code];
    NSArray *arr =[model.imgs componentsSeparatedByString:@","];
    int i=0;
    for (NSString *str in arr) {
        UIImageView *imageView =[[UIImageView alloc] initWithFrame:CGRectMake(5+i*(150/2), 4, 150/2-3, 90)];
        if (i==0) {
            [imageView sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"food9"]];
        }else{
            [imageView sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"food8"]];
        }
        
        [self.imgsimageView addSubview:imageView];
        i++;
    }
}
@end
